package edu.tjufe.llp.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import edu.tjufe.llp.entity.ChargeRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import edu.tjufe.llp.mapper.ChargeRecordMapper;
import edu.tjufe.llp.service.IChargeRecordService;

/**
 * 充电记录Service业务层处理
 * 
 * @author llp
 * @date 2022-12-25
 */
@Service
public class ChargeRecordServiceImpl extends ServiceImpl<ChargeRecordMapper, ChargeRecord> implements IChargeRecordService
{
    @Autowired
    private ChargeRecordMapper chargeRecordMapper;

    /**
     * 查询充电记录
     * 
     * @param recordId 充电记录主键
     * @return 充电记录
     */
    @Override
    public ChargeRecord selectChargeRecordByRecordId(Integer recordId)
    {
        return chargeRecordMapper.selectChargeRecordByRecordId(recordId);
    }

    /**
     * 查询充电记录列表
     * 
     * @param chargeRecord 充电记录
     * @return 充电记录
     */
    @Override
    public List<ChargeRecord> selectChargeRecordList(ChargeRecord chargeRecord)
    {
        return chargeRecordMapper.selectChargeRecordList(chargeRecord);
    }

    /**
     * 新增充电记录
     * 
     * @param chargeRecord 充电记录
     * @return 结果
     */
    @Override
    public int insertChargeRecord(ChargeRecord chargeRecord)
    {
        return chargeRecordMapper.insertChargeRecord(chargeRecord);
    }

    /**
     * 修改充电记录
     * 
     * @param chargeRecord 充电记录
     * @return 结果
     */
    @Override
    public int updateChargeRecord(ChargeRecord chargeRecord)
    {
        return chargeRecordMapper.updateChargeRecord(chargeRecord);
    }

    /**
     * 批量删除充电记录
     * 
     * @param recordIds 需要删除的充电记录主键
     * @return 结果
     */
    @Override
    public int deleteChargeRecordByRecordIds(Integer[] recordIds)
    {
        return chargeRecordMapper.deleteChargeRecordByRecordIds(recordIds);
    }

    /**
     * 删除充电记录信息
     * 
     * @param recordId 充电记录主键
     * @return 结果
     */
    @Override
    public int deleteChargeRecordByRecordId(Integer recordId)
    {
        return chargeRecordMapper.deleteChargeRecordByRecordId(recordId);
    }

    @Override
    public Page<ChargeRecord> findPage(Page<ChargeRecord> page, Integer carId, Integer stationId) {
        return chargeRecordMapper.findPage(page,carId,stationId);
    }
}
